/**
 * @author peter
 */
dojo.require("dojox.layout.FloatingPane");

dojo.provide("bunkai.bk_editor");
dojo.declare("bunkai.bk_editor", null,
{
	file_id: "",
	data : "", // The data that we're currently showing
	editorpane: "", // Where to add ourselves
	fpane: "", // Our floatingpane	

 	constructor: function(file_id)
	{		
		this.file_id = file_id;
		dojo.subscribe("editor_contents_"+this.file_id, function(arg)	
		{
			console.log("get ")
			this.setData(arg);
		});
	},
	
	
	
	setData: function(id, data)
	{
		this.data = data;
		this.update(data);
	},
	
	setEditorPane: function(pane)
	{
		this.editorpane = pane;
		/*
		 * <div title="Alt Dock 1" style="width:100px; height:100px; float:left;" 
			dojoType="dojox.layout.FloatingPane" duration="350" resizable="true" 
			dockTo="alternateDock" executeScripts="true" href="_script.html">
		 */
		if (!this.fpane)
		{
			var fdiv = document.createElement('div');
			this.fpane = new dojox.layout.FloatingPane(
			{
				resizable:true, 
				dockTo: "dock", 
				maxable:true, 
				dockable: true, 
				executeScripts: true}, fdiv);
		}
	},
	
	// This is implemented in subclasses
	update: function(data)
	{
		
	}
		
});